<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Inventory</title>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<?php include('includes/path.php'); ?>

</head>

<body class="oneColFixCtrHdr">
<div id="container">
<?php include( 'includes/header.php' ); ?>
<?php include( 'includes/menu.php' ); ?>

  <div id="mainContent">
<h1><center>Order Complete</center></h1>

<?php 
  // This file inserts the following
  // variables: USER, PASS, DB
  include('db.php'); 

?>
<?php
		$e = $_POST['quant'];
		$filter = '';
		if(isset($_POST['finishgood_list']))
		{
    		$filter = mysql_real_escape_string($_POST['finishgood_list']);
		}


		$PASS = "";
        $USER = "root";
        $HOST = "localhost";
        $CON = mysql_connect( $HOST, $USER, $PASS );
        $DB = "softengtestdatabase";
        if (!$CON)
          {
                  die('Could not connect: ' . mysql_error());
          }

        mysql_select_db( $DB );
        $y = rand();
        $sql="INSERT INTO Order_Requests(request_id, part_id, user_id, quantity, date) VALUES ('$y','$filter','00001','$e',now())";
        mysql_query($sql);

        mysql_close($CON);

        echo "<p><center>Your order for part $filter ($e) is now pending. Please wait for a manager to approve the order.</center></p>";
?>

 <!-- end #mainContent --></div>
<?php include('includes/footer.php'); ?>
<!-- end #container --></div>
</body>
</html>